.class final Lcom/melesta/engine/FacebookOperations$11;
.super Ljava/lang/Object;
.source "FacebookOperations.java"

# interfaces
.implements Lcom/facebook/Request$Callback;


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/melesta/engine/FacebookOperations;->receiveNotify(II)V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x8
    name = null
.end annotation


# instance fields
.field final synthetic val$callback:I

.field final synthetic val$me:Lcom/melesta/engine/EngineActivity;

.field final synthetic val$user_data:I


# direct methods
.method constructor <init>(Lcom/melesta/engine/EngineActivity;II)V
    .locals 0
    .parameter
    .parameter
    .parameter

    .prologue
    .line 826
    iput-object p1, p0, Lcom/melesta/engine/FacebookOperations$11;->val$me:Lcom/melesta/engine/EngineActivity;

    iput p2, p0, Lcom/melesta/engine/FacebookOperations$11;->val$user_data:I

    iput p3, p0, Lcom/melesta/engine/FacebookOperations$11;->val$callback:I

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public onCompleted(Lcom/facebook/Response;)V
    .locals 13
    .parameter "response"

    .prologue
    .line 831
    :try_start_0
    invoke-virtual {p1}, Lcom/facebook/Response;->getError()Lcom/facebook/FacebookRequestError;

    move-result-object v2

    .line 832
    .local v2, facebookError:Lcom/facebook/FacebookRequestError;
    if-eqz v2, :cond_1

    const/4 v6, 0x1

    .line 834
    .local v6, isErrorState:Z
    :goto_0
    if-eqz v6, :cond_2

    .line 870
    .end local v2           #facebookError:Lcom/facebook/FacebookRequestError;
    .end local v6           #isErrorState:Z
    :cond_0
    :goto_1
    return-void

    .line 832
    .restart local v2       #facebookError:Lcom/facebook/FacebookRequestError;
    :cond_1
    const/4 v6, 0x0

    goto :goto_0

    .line 837
    .restart local v6       #isErrorState:Z
    :cond_2
    invoke-virtual {p1}, Lcom/facebook/Response;->getGraphObject()Lcom/facebook/model/GraphObject;

    move-result-object v4

    .line 838
    .local v4, graphObject:Lcom/facebook/model/GraphObject;
    if-eqz v4, :cond_0

    .line 839
    const-string v11, "data"

    invoke-interface {v4, v11}, Lcom/facebook/model/GraphObject;->getProperty(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lorg/json/JSONArray;

    .line 840
    .local v0, data:Lorg/json/JSONArray;
    invoke-virtual {v0}, Lorg/json/JSONArray;->length()I

    move-result v7

    .line 841
    .local v7, len:I
    const/4 v5, 0x0

    .local v5, i:I
    :goto_2
    if-ge v5, v7, :cond_0

    .line 842
    invoke-virtual {v0, v5}, Lorg/json/JSONArray;->getJSONObject(I)Lorg/json/JSONObject;

    move-result-object v10

    .line 843
    .local v10, obj:Lorg/json/JSONObject;
    const-string v11, "id"

    invoke-virtual {v10, v11}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v9

    .line 844
    .local v9, notify_id:Ljava/lang/String;
    const-string v11, "from"

    invoke-virtual {v10, v11}, Lorg/json/JSONObject;->getJSONObject(Ljava/lang/String;)Lorg/json/JSONObject;

    move-result-object v11

    const-string v12, "id"

    invoke-virtual {v11, v12}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v3

    .line 845
    .local v3, from:Ljava/lang/String;
    const-string v11, "data"

    invoke-virtual {v10, v11}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v8

    .line 847
    .local v8, notify_data:Ljava/lang/String;
    if-eqz v8, :cond_3

    invoke-virtual {v8}, Ljava/lang/String;->length()I

    move-result v11

    if-lez v11, :cond_3

    .line 848
    iget-object v11, p0, Lcom/melesta/engine/FacebookOperations$11;->val$me:Lcom/melesta/engine/EngineActivity;

    new-instance v12, Lcom/melesta/engine/FacebookOperations$11$1;

    invoke-direct {v12, p0, v3, v8, v9}, Lcom/melesta/engine/FacebookOperations$11$1;-><init>(Lcom/melesta/engine/FacebookOperations$11;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V

    invoke-virtual {v11, v12}, Lcom/melesta/engine/EngineActivity;->runOnGLThread(Ljava/lang/Runnable;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 841
    :cond_3
    add-int/lit8 v5, v5, 0x1

    goto :goto_2

    .line 860
    .end local v0           #data:Lorg/json/JSONArray;
    .end local v2           #facebookError:Lcom/facebook/FacebookRequestError;
    .end local v3           #from:Ljava/lang/String;
    .end local v4           #graphObject:Lcom/facebook/model/GraphObject;
    .end local v5           #i:I
    .end local v6           #isErrorState:Z
    .end local v7           #len:I
    .end local v8           #notify_data:Ljava/lang/String;
    .end local v9           #notify_id:Ljava/lang/String;
    .end local v10           #obj:Lorg/json/JSONObject;
    :catch_0
    move-exception v1

    .line 861
    .local v1, e:Ljava/lang/Exception;
    invoke-static {v1}, Lcom/melesta/engine/Error;->processException(Ljava/lang/Exception;)V

    .line 862
    iget-object v11, p0, Lcom/melesta/engine/FacebookOperations$11;->val$me:Lcom/melesta/engine/EngineActivity;

    new-instance v12, Lcom/melesta/engine/FacebookOperations$11$2;

    invoke-direct {v12, p0}, Lcom/melesta/engine/FacebookOperations$11$2;-><init>(Lcom/melesta/engine/FacebookOperations$11;)V

    invoke-virtual {v11, v12}, Lcom/melesta/engine/EngineActivity;->runOnGLThread(Ljava/lang/Runnable;)V

    goto :goto_1
.end method
